package demo3;

import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 38917
 * Date: 2025-03-12
 * Time: 00:32
 */
public class Scanner_InputStream {
    public static void main(String[] args) {
        try(InputStream inputStream = Files.newInputStream(Paths.get("./aaa/bbb/ccc/a.text"))) {
            Scanner scanner = new Scanner(inputStream);
            while (scanner.hasNext()){
                System.out.println(scanner.next());
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
